package edu.gdkm.demo6.demo5;
//公共类要求类名和文件名相同,并且公共类只能有一个
public class Animal {
    public void show(){
        System.out.println("。。。");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.show();
        Cat cat=new Cat();
        cat.show();
    }
}
class Dog extends Animal{
    @Override
    public void show() {
        System.out.println("旺旺");
    }
}
class Cat extends Animal{
    @Override
    public void show() {
        System.out.println("喵喵");
    }
}
